/*
 * Powered By [rapid-framework]
 * Web Site: http://www.rapid-framework.org.cn
 * Google Code: http://code.google.com/p/rapid-framework/
 * Since 2008 - 2012
 */

package com.tech15.pub.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import com.tech15.pub.model.*;
import com.tech15.pub.dao.*;
import com.tech15.pub.service.*;
import com.tech15.pub.vo.query.*;

/**
 * @author 胡作正 email:zuozhenghu@sina.com
 * @version 1.0
 * @since 1.0
 */


@Entity
@Table(name = "EMPLOYEE_DEMAND")
public class EmployeeDemand extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;
	
	//alias
	public static final String TABLE_ALIAS = "员工诉求";
	public static final String ALIAS_ID = "序号";
	public static final String ALIAS_ZT = "主题";
	public static final String ALIAS_NR = "内容";
	public static final String ALIAS_YGID = "用户id";
	public static final String ALIAS_SQRQ = "诉求日期";
	public static final String ALIAS_SQZT = "诉求状态";
	public static final String ALIAS_HFNR = "回复内容";
	public static final String ALIAS_LB = "类别";
	public static final String ALIAS_HFRQ = "回复日期";
	
	//date formats
	public static final String FORMAT_SQRQ = DATE_FORMAT;
	public static final String FORMAT_HFRQ = DATE_FORMAT;
	

	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * 序号       db_column: ID 
     */ 	
	
	private Long id;
    /**
     * 主题       db_column: ZT 
     */ 	
	@Length(max=200)
	private java.lang.String zt;
    /**
     * 内容       db_column: NR 
     */ 	
	@Length(max=600)
	private java.lang.String nr;
    /**
     * 用户id       db_column: YGID 
     */ 	
	
	private Long ygid;
    /**
     * 诉求日期       db_column: SQRQ 
     */ 	
	
	private java.util.Date sqrq;
    /**
     * 诉求状态       db_column: SQZT 
     */ 	
	@Max(127)
	private Integer sqzt;
    /**
     * 回复内容       db_column: HFNR 
     */ 	
	@Length(max=600)
	private java.lang.String hfnr;
    /**
     * 类别       db_column: LB 
     */ 	
	
	private Long lb;
    /**
     * 回复日期       db_column: HFRQ 
     */ 	
	
	private java.util.Date hfrq;
	//columns END


	public EmployeeDemand(){
	}

	public EmployeeDemand(
		Long id
	){
		this.id = id;
	}

	

	public void setId(Long value) {
		this.id = value;
	}
	
	@Id @GeneratedValue(generator="custom-id")
	@GenericGenerator(name="custom-id", strategy = "increment")
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 22)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "ZT", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getZt() {
		return this.zt;
	}
	
	public void setZt(java.lang.String value) {
		this.zt = value;
	}
	
	@Column(name = "NR", unique = false, nullable = true, insertable = true, updatable = true, length = 600)
	public java.lang.String getNr() {
		return this.nr;
	}
	
	public void setNr(java.lang.String value) {
		this.nr = value;
	}
	
	@Column(name = "YGID", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getYgid() {
		return this.ygid;
	}
	
	public void setYgid(Long value) {
		this.ygid = value;
	}
	
	@Transient
	public String getSqrqString() {
		return DateConvertUtils.format(getSqrq(), FORMAT_SQRQ);
	}
	public void setSqrqString(String value) {
		setSqrq(DateConvertUtils.parse(value, FORMAT_SQRQ,java.util.Date.class));
	}
	
	@Column(name = "SQRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getSqrq() {
		return this.sqrq;
	}
	
	public void setSqrq(java.util.Date value) {
		this.sqrq = value;
	}
	
	@Column(name = "SQZT", unique = false, nullable = true, insertable = true, updatable = true, length = 2)
	public Integer getSqzt() {
		return this.sqzt;
	}
	
	public void setSqzt(Integer value) {
		this.sqzt = value;
	}
	
	@Column(name = "HFNR", unique = false, nullable = true, insertable = true, updatable = true, length = 600)
	public java.lang.String getHfnr() {
		return this.hfnr;
	}
	
	public void setHfnr(java.lang.String value) {
		this.hfnr = value;
	}
	
	@Column(name = "LB", unique = false, nullable = true, insertable = true, updatable = true, length = 22)
	public Long getLb() {
		return this.lb;
	}
	
	public void setLb(Long value) {
		this.lb = value;
	}
	
	@Transient
	public String getHfrqString() {
		return DateConvertUtils.format(getHfrq(), FORMAT_HFRQ);
	}
	public void setHfrqString(String value) {
		setHfrq(DateConvertUtils.parse(value, FORMAT_HFRQ,java.util.Date.class));
	}
	
	@Column(name = "HFRQ", unique = false, nullable = true, insertable = true, updatable = true, length = 7)
	public java.util.Date getHfrq() {
		return this.hfrq;
	}
	
	public void setHfrq(java.util.Date value) {
		this.hfrq = value;
	}
	
	

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("Zt",getZt())
			.append("Nr",getNr())
			.append("Ygid",getYgid())
			.append("Sqrq",getSqrq())
			.append("Sqzt",getSqzt())
			.append("Hfnr",getHfnr())
			.append("Lb",getLb())
			.append("Hfrq",getHfrq())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof EmployeeDemand == false) return false;
		if(this == obj) return true;
		EmployeeDemand other = (EmployeeDemand)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
	
	private String dataname;
	private String username;

	@Transient
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Transient
	public String getDataname() {
		return dataname;
	}

	public void setDataname(String dataname) {
		this.dataname = dataname;
	}
	
}

